Skip to content

Conversation

@idegtiarenko
Copy link
Contributor

This changes MockInternalClusterInfoService to fake entire data structure rather
than a getter call. This is required if the structure is copied by some
code (such as desired balance allocator).

This changes MockInternalClusterInfoService to fake entire data structure rather
 than a getter call. This is required if the structure is copied by some
 code (such as desired balance allocator).
@idegtiarenko idegtiarenko added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.5.0 labels Sep 15, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@Override
public String toString() {
return Strings.toString(this, true, false);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows to produce readable message if entire object is used in assertion

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

);
@Override
ShardStats[] adjustShardStats(ShardStats[] shardsStats) {
var shardSizeFunctionCopy = this.shardSizeFunction;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at one point we did need this to be lazier, but not any more it seems. In fact today all implementations are just constant functions returning either 0 or 1 so there's not really a need for this to be a function at all.

@idegtiarenko idegtiarenko merged commit 6f0652b into elastic:main Sep 19, 2022
@idegtiarenko idegtiarenko deleted the rework_MockInternalClusterInfoService branch September 19, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants